// 最后一次价格
const {DataTypes, db } = require("../db");
db.define('priceHis', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:'租户'}, 
buId:{type: DataTypes.INTEGER,defaultValue:0,comment:'客户，供应商ID'}, 
transType:{type: DataTypes.INTEGER,defaultValue:0,comment:'票据类型'}, 
invId:{type: DataTypes.INTEGER,defaultValue:0,comment:'商品ID'}, 
unit:{type: DataTypes.STRING(4),comment:'单位'}, 
price:{type: DataTypes.DECIMAL(10, 2),defaultValue:0,comment:'价格'}, 
deduction:{type: DataTypes.DECIMAL(10, 2),defaultValue:0,comment:'返现'}, 
locationId:{type: DataTypes.INTEGER,defaultValue:0,comment:'仓库'}, 
iid:{type: DataTypes.INTEGER,defaultValue:0,comment:'单据Id'}, 
unitId:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 

}, {
    tableName: 'price_his',
    timestamps: false,
    comment: '最后一次价格',
    
});